package work.mediway.mdm.biz.dto.biz;

import java.util.List;

import javax.validation.constraints.NotBlank;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import work.mediway.mdm.biz.entity.biz.SsDataQualityConfig;
import work.mediway.mdm.biz.entity.biz.SsDataQualityMapping;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/7/22
 */
@ApiModel(value = "数据质量配置")
@Data
public class DataQualityConfigDTO {

    @ApiModelProperty(value = "源系统id")
    @NotBlank(message = "不能为空")
    private String sourceAccessSystemId;

    @ApiModelProperty(value = "源系统模式名称")
    private String sourceSchemaName;

    @ApiModelProperty(value = "目标系统id", required = true)
    @NotBlank(message = "不能为空")
    private String targetAccessSystemId;

    @ApiModelProperty(value = "目标系统模式名称")
    private String targetSchemaName;

    @ApiModelProperty(value = "时间戳")
    private List<TimestampField> timestampFields;

    @ApiModelProperty(value = "配置")
    private List<SsDataQualityConfig> dataQualityConfigs;

    @ApiModelProperty(value = "未映射字段")
    private List<SsDataQualityMapping> dataQualityMappings;

    @Data
    public static class TimestampField {

        private String timestampField;

        private List<TableInfo> tableInfos;

        @Data
        public static class TableInfo {
            private String targetTableCode;

            private String targetSchemaName;
        }
    }
}
